from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views as auth_views
from chat_app import views as chat_views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('accounts/login/', auth_views.LoginView.as_view(template_name='registration/login.html'), name='login'),
    path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'),

    # 修改这里：包含 chat_app 的 URL 时添加命名空间
    path('', include('chat_app.urls', namespace='chat_app')),

    # 添加默认主页重定向到聊天页面
    path('', chat_views.chat_view, name='home'),
]